package com.javenwong.android.engine.scene;

import com.javenwong.android.engine.ImageManager;

public class Camera {
	
	private int x;
	private int y;
	
	private Scene scene;
	
	public Camera(Scene scene){
		this(0, 0, scene);
	}

	public Camera(int x, int y, Scene scene) {
		super();
		this.x = x;
		this.y = y;
		this.scene = scene;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
	
	public void move(int dx, int dy){
		
		if ( x >= scene.getWidth()-ImageManager.STANDARD_WIDTH ){
			
			x = scene.getWidth()-ImageManager.STANDARD_WIDTH;

			return;
		}
		
		x+=dx;
		y+=dy;
	}
}
